fix(metadata-admin): validation messages name the offending widget + field#1940
Merged
Conversation
…field A nested Zod issue (e.g. `widgets.2.layout`) was shown as just its head field label — "Widgets: Invalid input" — so an author couldn't tell WHICH widget or sub-field was at fault. labelForIssuePath dropped everything after the first path segment. Add describeIssuePath: for a nested path it appends a readable trail, resolving each array index to the item's stable identity (id/name/title, incl. I18nLabel objects) from the draft — "Widgets → priority_split → layout". Single-segment paths are unchanged. Pure + unit-tested (5 cases); labelForIssuePath now computes the head label then delegates. Found dogfooding the Studio dashboard designer. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Found dogfooding the Studio dashboard designer. A nested validation issue (e.g. a Zod issue at
widgets.2.layout) was rendered as just its head field label — "Widgets: Invalid input" — so an author couldn't tell which widget or which sub-field was at fault.labelForIssuePathdropped every path segment after the first.Fix
Add
describeIssuePath(pure, unit-tested): for a nested path it appends a readable trail, resolving each array index to the item's stable identity (id/name/title, including I18nLabel{ key, defaultValue }objects) from the draft:"Widgets"stays"Widgets").labelForIssuePathnow resolves the head label, then delegates the nested trail to the helper.Verification
describeIssuePathunit test — 5 passed (single-segment, nested-by-id, index fallback, I18nLabel resolution, missing-array).string, string, unknown); objectui CI builds deps + typechecks + runs the suite.Found alongside objectstack-ai/framework#2247 / objectui#1925 (dashboard designer dogfooding).
🤖 Generated with Claude Code